<%@page contentType="text/html; charset=utf-8" language="java"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>加油信息查询</title>
	<jsp:include page="/common/header-common.jsp"></jsp:include>
	<script type="text/javascript">
	$($.date_input.initialize);
	function goUrl(pageIndex){
		searchFrm.currPage.value = pageIndex;
		searchFrm.submit();
	}
	function expExcel() {
		window.location = "../expexcel.action?type=refuelQuery&simnum=" + document.getElementById("simnum").value
			+ "&btime=" + document.getElementById("btime").value + "&etime=" + document.getElementById("etime").value;
	}
	</script>
</head>
	<body id="refuelquery">
	<div id="aaaa" style="position: absolute;top: 0px; left: 0px;"></div>
		<div id="wrapper">
			<s:include value="/common/header.jsp"></s:include>
			<form id="searchFrm" name="searchFrm" method="post" action="refuelQuery.action">
			<input type="hidden" name="currPage" value="0" />
			<jsp:include page="navication.jsp"></jsp:include>
			<div id="rss_content">
				<div class="rss_title">加油信息查询</div>
				<div class="rss_description">您在这里查看的是加油信息</div>
				<s:if test="message != null">
					<div class="return_tip">
						<s:property value="message" />
					</div>
				</s:if>
				<table width="98%" border="0" cellpadding="1" cellspacing="5" class="tab_1">
							<tr align="left">
								<td height="40">
									&nbsp;车号：
									<s:select id="simnum" list="suser.sdevices" listKey="simnum" listValue="carnum" name="simnum" headerKey="" headerValue="所有" theme="simple"></s:select>
									&nbsp;加油时间：
									<input type="text" id="btime" name="btime" size="15" maxlength="14"
										value='<s:property value="btime"/>' class="date_input"/>
									-
									<input type="text" id="etime" name="etime" size="15" maxlength="14"
										value='<s:property value="etime"/>' class="date_input"/>
									<span style="cursor: hand"><img
											src="../images/search.gif" width="51" height="23"
											align="absmiddle" onClick="document.forms[0].submit();" /> </span>
											
									<span style="cursor: hand"><img src="../images/bt_exp.jpg" width="71" height="23"
											align="absmiddle" onClick="expExcel()" />	</span>
								</td>
							</tr>
						</table>
				<div id="placeholder" style="width:600px;height:300px;"></div>
				
				<script id="source" language="javascript" type="text/javascript">
					$(function () {
					    var sin = [], cos = [];
					    <s:iterator value="bean.devicediagram">
							sin.push([<s:property value="key"/>, <s:property value="value"/>]);
						</s:iterator>
					
					    var plot = $.plot($("#placeholder"),
					           [ { data: sin} ], {
					               series: {
					                   lines: { show: true },
					                   points: { show: true }
					               },
					               grid: { hoverable: true, clickable: true }
					             });
					
					    function showTooltip(x, y, contents) {
					        $('<div id="tooltip">' + contents + '</div>').css( {
					            position: 'absolute',
					            display: 'none',
					            top: y + 5,
					            left: x + 5,
					            border: '1px solid #fdd',
					            padding: '2px',
					            'background-color': '#fee',
					            opacity: 0.80
					        }).appendTo("body").fadeIn(200);
					    }
					
					    var previousPoint = null;
					    $("#placeholder").bind("plothover", function (event, pos, item) {
					
				            if (item) {
				                if (previousPoint != item.datapoint) {
				                    previousPoint = item.datapoint;
				                    
				                    $("#tooltip").remove();
				                    var x = item.datapoint[0].toFixed(2),
				                        y = item.datapoint[1].toFixed(2);
				                    
				                    showTooltip(item.pageX, item.pageY,
				                                parseInt(x) + "共加油" +parseInt(y)+"次");
				                }
				            }
				            else {
				                $("#tooltip").remove();
				                previousPoint = null;            
				            }
					    });
					
					    $("#placeholder").bind("plotclick", function (event, pos, item) {
					        if (item) {
					            plot.highlight(item.series, item.datapoint);
					        }
					    });
					});
					</script>
			</div>
			</form>
			<div style="clear: both;"></div>
			<div style="height: 40px;" ></div>
			<s:include value="/common/footer.jsp"></s:include>
		</div>
		
	</body>
</html>